#include "BoundaryFunction.h"
double u(double *p)
{
    return p[0]+p[1];
}
double u1(double *p)
{
    return p[0]+2 * p[1];
}
double a(double *p)
{
    return 1;
}
int main()
{
    RectangleDomain* r = new RectangleDomain({{0,0},{1,0},{1,1},{0,1}});
    std::vector<Boundary<2>> B = r->boundary();
    BoundaryFunction<2> * bf1 = new Dirichlet<2>(u,B[0]);
    BoundaryFunction<2> * bf2 = new Neumann<2>(u,a,B[1]);
    BoundaryFunction<2> * bf3 = new Neumann<2>(u,a,B[2]);
    BoundaryFunction<2> * bf4 = new Dirichlet<2>(u1,B[3]);
    BoundaryCondition<2> bfc;
    double a[2] = {1,5};
    bfc.add(bf1);
    bfc.add(bf2);
    bfc.add(bf3);
    bfc.add(bf4);
    std::cout << bfc.BFlist()[3]->g()(a) << std::endl;
    BoundaryCondition<2> bfc2 = bfc;
    std::cout << bfc2.BFlist()[0]->boundaryType() << std::endl;
    std::cout << bfc2.BFlist()[3]->g()(a) << std::endl;
    delete r;
}